package org.example.weboj.service;

import java.util.Optional;

import org.example.weboj.entity.User;

import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author wza
 * @since 2025-04-03
 */
public interface IUserService extends IService<User> {
    
    /**
     * Authenticates a user by username and password
     * 
     * @param username the username
     * @param password the plain text password
     * @return the authenticated user or empty if authentication failed
     */
    Optional<User> authenticate(String username, String password);
    
    /**
     * Finds a user by username
     * 
     * @param username the username
     * @return the user or empty if not found
     */
    Optional<User> findByUsername(String username);
}
